'\" te
.\" This manual page is derived from the DAT/uDAPL 1.2 specification.
.\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DAT_EP_POST_SEND 3DAT "Jul 16, 2004"
.SH NAME
dat_ep_post_send \- transfer data to the remote side
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-ldat\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <\fBdat/udat.h\fR>

DAT_RETURN
    dat_ep_post_send (
    IN    DAT_EP_HANDLE        ep_handle,
    IN    DAT_COUNT            num_segments,
    IN    DAT_LMR_TRIPLET      *local_iov,
    IN    DAT_DTO_COOKIE       user_cookie,
    IN    DAT_COMPLETION_FLAGS completion_flags
    )
.fi

.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIep_handle\fR\fR
.ad
.RS 20n
Handle for an instance of the Endpoint.
.RE

.sp
.ne 2
.na
\fB\fInum_segments\fR\fR
.ad
.RS 20n
Number of \fIlmr_triplets\fR in \fIlocal_iov\fR. Can be 0 for 0 size message.
.RE

.sp
.ne 2
.na
\fB\fIlocal_iov\fR\fR
.ad
.RS 20n
I/O Vector that specifies the local buffer that contains data to be
transferred. Can be \fINULL\fR for 0 size message.
.RE

.sp
.ne 2
.na
\fB\fIuser_cookie:\fR\fR
.ad
.RS 20n
User-provided cookie that is returned to the Consumer at the completion of the
send. Can be \fINULL\fR.
.RE

.sp
.ne 2
.na
\fB\fIcompletion_flags\fR\fR
.ad
.RS 20n
Flags for posted Send. The default \fBDAT_COMPLETION_DEFAULT_FLAG\fR is 0x00.
Other values are as follows:
.sp
.ne 2
.na
\fBCompletion Suppression\fR
.ad
.RS 30n
\fBDAT_COMPLETION_SUPPRESS_FLAG\fR
.sp
.ne 2
.na
\fB0x01\fR
.ad
.RS 8n
Suppress successful Completion.
.RE

.RE

.sp
.ne 2
.na
\fBSolicited Wait\fR
.ad
.RS 30n
\fBDAT_COMPLETION_SOLICITED_WAIT_FLAG\fR
.sp
.ne 2
.na
\fB0x02\fR
.ad
.RS 8n
Request for notification completion for matching receive on the other side of
the connection.
.RE

.RE

.sp
.ne 2
.na
\fBNotification of Completion\fR
.ad
.RS 30n
\fB\fR\fBDAT_COMPLETION_UNSIGNALLED_FLAG\fR
.sp
.ne 2
.na
\fB0x04\fR
.ad
.RS 8n
Non-notification completion. Local Endpoint must be configured for Notification
Suppression.
.RE

.RE

.sp
.ne 2
.na
\fBBarrier Fence\fR
.ad
.RS 30n
\fB\fR\fBDAT_COMPLETION_BARRIER_FENCE_FLAG\fR
.sp
.ne 2
.na
\fB0x08\fR
.ad
.RS 8n
Request for Barrier Fence.
.RE

.RE

.RE

.SH DESCRIPTION
.sp
.LP
The \fBdat_ep_post_send()\fR function requests a transfer of all the data from
the \fIlocal_iov\fR over the connection of the \fIep_handle\fR Endpoint to the
remote side.
.sp
.LP
The \fInum_segments\fR parameter specifies the number of segments in the
\fIlocal_iov\fR. The \fIlocal_iov\fR segments are traversed in the I/O Vector
order until all the data is transferred.
.sp
.LP
A Consumer cannot modify the \fIlocal_iov\fR or its content until the DTO is
completed. When a Consumer does not adhere to this rule, the behavior of the
Provider and the underlying Transport is not defined. Providers that allow
Consumers to get ownership of the \fIlocal_iov\fR back after the
\fBdat_ep_post_send()\fR returns should document this behavior and also specify
its support in Provider attributes. This behavior allows Consumers full control
of the \fIlocal_iov\fR, but not the memory it specifies after
\fBdat_ep_post_send()\fR returns. Because this behavior is not guaranteed by
all Providers, portable Consumers should not rely on this behavior. Consumers
should not rely on the Provider copying \fIlocal_iov\fR information.
.sp
.LP
The \fBDAT_SUCCESS\fR return of the \fBdat_ep_post_send()\fR is at least the
equivalent of posting a Send operation directly by native Transport. Providers
should avoid resource allocation as part of \fBdat_ep_post_send()\fR to ensure
that this operation is nonblocking and thread safe for an UpCall.
.sp
.LP
The completion of the posted Send is reported to the Consumer asynchronously
through a DTO Completion event based on the specified \fIcompletion_flags\fR
value. The value of \fBDAT_COMPLETION _UNSIGNALLED_FLAG\fR is only valid if the
Endpoint Request Completion Flags \fBDAT_COMPLETION_UNSIGNALLED_FLAG\fR.
Otherwise, \fBDAT_INVALID_PARAMETER\fR is returned.
.sp
.LP
The \fIuser_cookie\fR allows Consumers to have unique identifiers for each DTO.
These identifiers are completely under user control and are opaque to the
Provider. There is no requirement on the Consumer that the value
\fIuser_cookie\fR should be unique for each DTO. The \fIuser_cookie\fR is
returned to the Consumer in the Completion event for the posted Send.
.sp
.LP
The operation is valid for the Endpoint in the \fBDAT_EP_STATE_CONNECTED\fR and
\fBDAT_EP_STATE_DISCONNECTED\fR states. If the operation returns successfully
for the Endpoint in the \fBDAT_EP_STATE_DISCONNECTED\fR state, the posted Send
is immediately flushed to \fIrequest_evd_handle\fR.
.SH RETURN VALUES
.sp
.ne 2
.na
\fB\fBDAT_SUCCESS\fR\fR
.ad
.RS 30n
The operation was successful.
.RE

.sp
.ne 2
.na
\fB\fBDAT_INSUFFICIENT_RESOURCES\fR\fR
.ad
.RS 30n
The operation failed due to resource limitations.
.RE

.sp
.ne 2
.na
\fB\fBDAT_INVALID_PARAMETER\fR\fR
.ad
.RS 30n
Invalid parameter. For example, one of the IOV segments pointed to a memory
outside its LMR.
.RE

.sp
.ne 2
.na
\fB\fBDAT_INVALID_HANDLE\fR\fR
.ad
.RS 30n
The \fIep_handle\fR parameter is invalid.
.RE

.sp
.ne 2
.na
\fB\fBDAT_INVALID_STATE\fR\fR
.ad
.RS 30n
A parameter is in an invalid state. Endpoint was not in the
\fBDAT_EP_STATE_CONNECTED\fR or \fBDAT_EP_STATE_DISCONNECTED\fR state.
.RE

.sp
.ne 2
.na
\fB\fBDAT_PROTECTION_VIOLATION\fR\fR
.ad
.RS 30n
Protection violation for local or remote memory access. Protection Zone
mismatch between an LMR of one of the \fIlocal_iov\fR segments and the local
Endpoint.
.RE

.sp
.ne 2
.na
\fB\fBDAT_PRIVILEGES_VIOLATION\fR\fR
.ad
.RS 30n
Privileges violation for local or remote memory access. One of the LMRs used in
\fIlocal_iov\fR was either invalid or did not have the local read privileges.
.RE

.SH USAGE
.sp
.LP
For best Send operation performance, the Consumer should align each buffer
segment of \fIlocal_iov\fR to the Optimal Buffer Alignment attribute of the
Provider. For portable applications, the Consumer should align each buffer
segment of \fIlocal_iov\fR to the \fBDAT_OPTIMAL_ALIGNMENT\fR.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Standard: uDAPL, 1.1, 1.2
_
MT-Level	Unsafe
.TE

.SH SEE ALSO
.sp
.LP
.BR libdat (3LIB),
.BR attributes (7)
